Skip to main content

Set Focus

AutomatR.Web.SetFocus

The "Set Focus" activity in AutomatR is designed for UI automation workflows, specifically for setting keyboard focus to a specified UI element on a web page. This activity ensures that the targeted UI element is ready to receive user input, facilitating seamless automation of user interactions.

Properties

NameDescription
Input
ElementSelect the web element using the provided selector window. This indicates the UI element on the web page. Use either the "Element" or "WebElement" property.
WebElementEnter the UI element variable identified by the "Find Element" or other activities. Use either the "Element" or "WebElement" property.
Misc
Display NameProvides a customizable name for the activity displayed in the workflow. String variables containing the desired display name.
Optional
TimeoutEnter the time, in seconds (e.g., 5), for the activity to be executed before throwing an exception. This is the maximum time the activity will wait for the UI element to receive focus. If not provided, a default timeout will be used.
DelayEnter the wait time in seconds before starting the activity. This can be useful for handling synchronization issues or waiting for specific conditions before setting focus.

How to use:

  1. Drag and drop the "Set Focus" activity onto the workflow.
  2. Configure the properties by selecting the web element or providing the UI element variable.
  3. Optionally, configure the timeout and delay.
  4. Execute the workflow to set the keyboard focus to the specified UI element on the web page.

Example: Consider an example where the "Set Focus" activity is used to focus on a search input field on a web page:

Set Focus:
Element: (Use the selector window to choose the search input field)
Timeout: 5 (seconds)
Delay: 2 (seconds)

In this example, the activity sets the keyboard focus on the specified search input field, allowing subsequent activities to interact with it. The timeout is set to 5 seconds, and there's a delay of 2 seconds before starting the activity.